Skip to content

Test: integration tests for clinic#194

Merged
TatjanaTrajkovic merged 2 commits into
mainfrom
test/integration_tests_clinic
Apr 12, 2026
Merged

Test: integration tests for clinic#194
TatjanaTrajkovic merged 2 commits into
mainfrom
test/integration_tests_clinic

Conversation

@TatjanaTrajkovic

@TatjanaTrajkovic TatjanaTrajkovic commented Apr 12, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Tests
    • Added comprehensive integration tests for the clinic REST API covering create, list, retrieve, update, delete, and error cases (invalid create, not found), using an in-memory test profile and mocked external dependencies.

@coderabbitai

coderabbitai Bot commented Apr 12, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 38dd9c29-d8b6-4972-82cb-dc6f3d67ca22

📥 Commits

Reviewing files that changed from the base of the PR and between 43fd18a and b17de59.

📒 Files selected for processing (1)
  • src/test/java/org/example/vet1177/integration/clinic/ClinicIntegrationTest.java
✅ Files skipped from review due to trivial changes (1)
  • src/test/java/org/example/vet1177/integration/clinic/ClinicIntegrationTest.java

📝 Walkthrough

Walkthrough

Adds a new Spring Boot integration test class for clinic REST endpoints (CRUD + error cases) and removes a trailing newline from pom.xml. The tests run with an in-memory H2 database, mock file storage properties/services, and validate API responses against repository state.

Changes

Cohort / File(s) Summary
Build configuration
pom.xml
Removed trailing newline at end of file (no functional change).
Clinic integration tests
src/test/java/org/example/vet1177/integration/clinic/ClinicIntegrationTest.java
New integration test class (8 tests) exercising /api/clinics POST/GET/PUT/DELETE, validation (400) and not-found (404). Uses @SpringBootTest, @AutoConfigureMockMvc(addFilters = false), H2 (Postgres mode) via @TestPropertySource, and Mockito beans for FileStorageService and AwsS3Properties.

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related issues

Possibly related PRs

Suggested reviewers

  • lindaeskilsson
  • annikaholmqvist94

Poem

🐰 I hopped in code with eager paws,

I spun up H2 and ran the laws,
I POSTed, GOT, and PUT with glee,
Deleted bugs — one, two, and three,
Tests pass — a carrot treat for me! 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: introducing integration tests for the clinic API endpoint. It is specific, concise, and clearly summarizes the primary addition to the codebase.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/integration_tests_clinic

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@TatjanaTrajkovic TatjanaTrajkovic linked an issue Apr 12, 2026 that may be closed by this pull request

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@src/test/java/org/example/vet1177/integration/clinic/ClinicIntegrationTest.java`:
- Line 71: In ClinicIntegrationTest replace all Java assert statements (e.g.,
the occurrence "assert clinicRepository.findAll().size() == 1;" and the other
assert uses in the same test class) with JUnit assertions from
org.junit.jupiter.api.Assertions: use Assertions.assertEquals(expected, actual,
message) for size/equality checks, Assertions.assertTrue(condition, message) for
boolean checks, and Assertions.assertNotNull(...) where appropriate; add the
necessary import (or static import) and update each assertion site (referencing
clinicRepository.findAll(), the other repository/result expressions used in
those assertions) so the checks run deterministically under Maven test
execution.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 02b96f1d-d437-48f1-822d-5cdbcc060c28

📥 Commits

Reviewing files that changed from the base of the PR and between 63d9643 and 43fd18a.

📒 Files selected for processing (2)
  • pom.xml
  • src/test/java/org/example/vet1177/integration/clinic/ClinicIntegrationTest.java

Comment thread src/test/java/org/example/vet1177/integration/clinic/ClinicIntegrationTest.java Outdated
@TatjanaTrajkovic
TatjanaTrajkovic merged commit 8f78daa into main Apr 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test: integrationtests for clinic

1 participant